﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HlcLogViewer
{
    public partial class Form_LogDetail : Form
    {
        private LogModel m_log;
        public Form_LogDetail()
        {
            InitializeComponent();
        }

        public Form_LogDetail(LogModel log) : this()
        {
            m_log = log;
        }

        private void Form_LogDetail_Load(object sender, EventArgs e)
        {
            lb_level.Text = m_log.LogLevel.ToString();

            lb_datetime.Text = m_log.DateTime.ToString();

            lb_thread.Text = m_log.Thread;

            txt_message.Text = m_log.Message + Environment.NewLine + m_log.Exception;
            txt_message.BackColor = LogViewUtil.ConvertBackColor(m_log.LogLevel, txt_message.BackColor);
            txt_message.ForeColor = LogViewUtil.ConvertForColor(m_log.LogLevel, txt_message.ForeColor);
            
        }
    }
}
